<!DOCTYPE html>
<html lang="cz">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        .box1,.box2{
            width: 200px;
            height: 200px;
            float: left;
        }
        .box1{
            background-color: yellow;
        }
        .box2{
            background-color: blue;
        }
        .box{
            background-color: red;
            width: 300px;
            height: 300px;
            /* clear: left; */

        }

        /* 写固定高度 */
        .container{
            /* height: 200px; */
            overflow: hidden;
            /* bfc 让浮动元素计算高度 */

        }
        /* 清浮动 clear: left; 是什么浮动就清什么浮动 */
        /*  <div style="clear: left;"></div> 浮动元素后面补一个盒子  */
        /*  overflow:hidden */


    </style>
</head>
<body>
    
    <div class="container">
        <div class="box1"></div>
        <div class="box2"></div>
        <!-- <div style="clear: left;"></div> -->
       
    </div>

    <div class="box"></div>

</body>
</html>